<include file="Public/head" />

<body>
  <div class="panel admin-panel">
    <div class="panel-head"><strong class="icon-reorder"> 门面管理</strong></div>
    <div class="padding border-bottom">
      <a class="button border-main icon-plus-square-o" href="{:U('store/addStore')}"> {:L("tianjia")}</a>
    </div>
    <table class="table table-hover text-center">
      <tr>
        <th width="10%">{:L("menmianmingcheng")}</th>
        <th width="20%">{:L("menmiandizhi")}</th>
        <th width="10%">{:L("menmiandianhua")}</th>
        <th width="10%">{:L("menmianyouxiang")}</th>
        <th width="10%">{:L("caozuo")}</th>
      </tr>
      <foreach name="info" item="v">
        <tr class="o{$v['s_id']}">
          <td>{$v['store_name']}</td>
          <td>{$v['address']}</td>
          <td>{$v['tel']}</td>
          <td>{$v['email']}</td>
          <td>
            <div class="button-group">
              <a class="button border-main" href="{:U('Store/editStore',array('id'=>$v['s_id']))}"><span class="icon-edit"></span> {:L("bianji")}</a>
              <a class="button border-red" href="javascript:void(0)" onclick="return del({$v['s_id']})"><span class="icon-trash-o"></span> {:L("shanchu")}</a>
            </div>
          </td>
        </tr>
        <!--<if condition="$v['sonlist']">-->
          <!--<foreach name="v['sonlist']" item="v2">-->
            <!--<tr style="background: #f0f0f0" class="o{$v2['goods_cate_id']} p{$v2['p_id']}">-->
              <!--<td>{$v2['sort']}</td>-->
              <!--<td>{$v['goods_cate_name']} -&#45;&#45; {$v2['goods_cate_name']}</td>-->
              <!--<td>-->
                <!--<span class="sp01" onclick="is_show({$v2['goods_cate_id']},this)">-->
                  <!--<if condition="$v2['is_show'] == 1">-->
                    <!--<img src="__PUBLIC__/web/images/yes.png" width="18px;" >-->
                    <!--<else />-->
                    <!--<img src="__PUBLIC__/web/images/no.png" width="18px;" >-->
                  <!--</if>-->
                <!--</span>-->
              <!--</td>-->
              <!--<td>-->
                <!--<div class="button-group">-->
                  <!--<a class="button border-main" href="{:U('Goodscate/edit',array('id'=>$v2['goods_cate_id']))}"><span class="icon-edit"></span> {:L("bianji")}</a>-->
                  <!--<a class="button border-red" href="javascript:void(0)" onclick="return del({$v2['goods_cate_id']})"><span class="icon-trash-o"></span> {:L("shanchu")}</a>-->
                <!--</div>-->
              <!--</td>-->
            <!--</tr>-->
          <!--</foreach>-->
        <!--</if>-->
      </foreach>
    </table>
  </div>
  <script type="text/javascript">
    function del(id){
      if(confirm("{:L('shanchuxiaoxi')}")){
        var url = "{:U('Store/delStore')}";
        $.getJSON(url,{id:id},function (data){
          if(data.result == 'tp1'){$(".o"+id).remove();}
          else if(data.result == 'break'){alert('ERROR.');}
        })
      }
    }
    function is_show(id,t){
      var url = "{:U('Goodscate/is_show')}";
      $.getJSON(url,{id:id},function (data){
        if(data.result == 'yes'){
          $(t).find('img').attr('src',"__PUBLIC__/web/images/yes.png");
        }else if(data.result == 'no'){
          $(t).find('img').attr('src',"__PUBLIC__/web/images/no.png");
        }
      })
    }
  </script>
</body>

</html>